package com.example.myapplication.kt

import com.chinanetcenter.wcs.android.slice.Block
import kotlinx.coroutines.CoroutineScope
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.InvocationKind
import kotlin.contracts.contract
import kotlin.coroutines.CoroutineContext

/**
 * @description:
 *
 * @author: wangrongfeng
 *
 * @create: 2023-04-26 11:54
 **/

class Main {
    fun launchGo(
        block: suspend CoroutineScope.() -> Unit,
        error: suspend CoroutineScope.(String) -> Unit = {

        }
    ) {

    }

    fun test(string: CharSequence.() -> Int) {
       val  aaa = test2 {

        }
        val  bbb = test2 {
            string
        }
        println(aaa)
        println(bbb)
    }

    fun <T> test2(block: CharSequence.() -> T): T {
        return block.invoke("123")
    }

}


fun main() {
    val main = Main()
//    main.launchGo({
//
//    },{
//
//    })

    main.test {
        123
    }
}